Skip to content

REF: make Block.delete return a new Block #45689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

I lost track of the original use case that motivated this, but in general i think we're better off keeping block.values fixed.

@mroeschke mroeschke added the Internals Related to non-user accessible pandas implementation label Jan 30, 2022
self._blklocs[blk.mgr_locs.indexer] = np.arange(len(blk))
nb = blk.delete(blk_locs)
blocks_tup = (
self.blocks[:blkno_l] + (nb,) + self.blocks[blkno_l + 1 :]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blkno_l is never negative here right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

@mroeschke mroeschke added this to the 1.5 milestone Jan 30, 2022
@jreback
Copy link
Contributor

jreback commented Jan 30, 2022

@jbrockmendel
Copy link
Member Author

are these unrelated?

Yes. These were fixed in #45707

@jreback jreback merged commit 4d21758 into pandas-dev:main Jan 30, 2022
@jbrockmendel jbrockmendel deleted the bug-block-delete branch January 30, 2022 18:51
@jbrockmendel
Copy link
Member Author

Nice. Now #45352 is all that's left between us and block.values being immutable

phofl pushed a commit to phofl/pandas that referenced this pull request Feb 14, 2022
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants